Let's suppose we have a fair coin and we flipped it four times. I'd like you to tell me what is the probability that there is exactly one head divided by the probability that only the very first flip is a head.
Answer
H T T T
T H T T
T T H T
T T T H
heads = 0.5 tails = 0.5
(0.5 * 0.5 * 0.5 * 0.5) * 4 / (0.5 * 0.5 * 0.5 * 0.5) = 4
Screenshot taken from Udacity
Now, I'd like to tell me the ratio of the probability of exactly one head to the probability of the first flip being heads regardless of the other flips.
Answer
2*2*2=8 and 4/8=0.5
Screenshot taken from Udacity
Answer
Problem's given:
Probability we randomly choose the fair coin (coin 1): P(1)=0.5
Probability we randomly choose the loaded coin (coin 2): P(2)=0.5
Probability that the coin shows heads GIVEN that it's the fair coin (coin 1): P(H|1)=0.5
Probability that the coin shows heads GIVEN that it's the loaded coin (coin 2): P(H|2)=0.9
My flips: HHT
Your flips: THH
Problem's aim:
The problem asks for the probability that both coins flipped were of the same kind.
Someone could argue: "Well that's easy. It's the probability of both people randomly selecting the fair coin (coin 1) plus the probability of both of them randomly selecting the loaded coin (coin 2). That is: $%P(1 \cap 1) + P(2 \cap 2)=P(1) \cdot P(1)+P(2) \cdot P(2)=0.5 \cdot 0.5+0.5 \cdot 0.5=0.5$%, since $%P(1 \cap 1)=P(1) \cdot P(1)$% is the joint probability of two independent events, the first person selecting coin 1 and the second person also selecting coin 1. This looks logical; half of the time the two persons select the same coin". The truth table verifies this:
-----1st person --------------------------- 2ndperson-------
coin1 coin1
coin1 coin2
coin2 coin1
coin2 coin2
But, wait. There is a catch: the flips were not taken into account!
Reading more carefully the problem asks for the probability that both coins flipped were of the same kind, GIVEN the flips observed, i.e. $%P(1|HHT)$% and $%P(2|HHT)$%
Note: The sequence of the flips does not change the probability of the flips, i.e. both flips are of equal probability.
Solution:
Given that we selected a fair coin (coin1), the probability for the flips is $$P(HHT|1)=0.5\cdot 0.5\cdot 0.5=0.125$$ Hence the probability $$P(HHT \cap 1)=P(HHT|1) \cdot P(1)=0.125 \cdot 0.5=0.0625$$
Likewise, given that we selected the loaded coin (coin2), the probability for the flips is $$P(HHT|2)=0.9\cdot 0.9\cdot (1-0.9)=0.081$$
$$P(HHT \cap 2)=P(HHT|2) \cdot P(2)=0.081 \cdot 0.5=0.0405$$Thus $$P(HHT)=P(HHT \cap 1)+P(HHT \cap 2)=0.0625+0.0405=0.103$$
So $$P(1|HHT)= \large \frac {P(HHT \cap 1)} {P(HHT)} \normalsize = \frac {0.0625}{0.103} =0.606796117$$
and $$P(2|HHT)= \large \frac {P(HHT \cap 2)} {P(HHT)} \normalsize = \frac {0.0405}{0.103} =0.393203883$$
Finally, the probability of both persons selecting the same kind of coins is $$P(1|HHT) \cdot P(1|HHT)+P(2|HHT) \cdot P(2|HHT)=0.606796117^2+0.393203883^2=0.522810821$$
Screenshot taken from Udacity
Now, I'd like to ask you about what happens as the number of flips or events, in general, becomes a very large number. Check all that apply.
# flips # cases Pr. per case possible cases
2 2^2 = 4 1/4 = 0.25 HH, HT, TH, TT
3 2^3 = 8 1/8 = 0.125 HHH, HHT, HTH, HTT, THH, THT, TTH, TTT
4 2^4 = 16 1/16 = 0.0625 HHHH, HHHT, HHTH, HHTT, HTHH, HTHT, ...
1 - The probability of every sequence becomes small.
The probability of any one sequence is
$$P(\mbox{any one sequence}) = \frac{1}{\mbox{num permutations}} = \frac{1}{2^{\mbox{flips}} }$$so more flips, smaller probability
2 - The probability of every number of heads becomes small.
This could mean 2 things. One, the total number of heads:
P(2 heads) for 2 flips = P(HH) = 1/4 = 0.25
P(2 heads) for 3 flips = P(HHT)+P(HTH)+P(THH) = 1/8 * 3 = 3/8 = 0.375
P(2 heads) for 4 flips = P(HHTT)+P(HTHT)+P(HTTH)+
P(THTH)+P(THHT)+P(TTHH) = 1/16 * 6 = 0.375
P(2 heads) for 5 flips = 10 * 1/32 = 0.3125
which gets smaller with the number of flips or, two, the number of heads in a sequence, like exactly 2 heads followed by tails, in which case we have:
P(2 heads plus tails) for 2 flips = P(HH) = 1/4
P(2 heads plus tails) for 3 flips = P(HHT) = 1/8
P(2 heads plus tails) for 4 flips = P(HHTT) = 1/16
which also gets smaller with the number of flips
3 - The probability of every proportion of heads becomes small.
For example, I want half the flips (i.e., a proportion) to be heads
P(1/2 of 2 flips are heads) = P(HT) + P(TH)
= 1/4 + 1/4 = 1/2
P(1/2 of 4 flips are heads) = P(HHTT) + P(HTHT) + P(THTH) +
P(THHT)+ P(TTHH) + P(HTTH)
= 6*(1/2^4) = 3/8
4- The probability of every range of proportions becomes small. ok.. there were several comments about my original explanation of points 4 and 5 being unclear and.. sure enough.. they were. I was not happy with the explanations either so I figured out a way to explain them in a different way without getting too much into combinatorics.
First let's figure out the basics. If I flip a coin n times I generate one of $%2^n$% sequences. How many of those possible sequences have k heads? One way to find the answer is to use Pascal's triangle, in which an entry in the triangle is the sum of the two entries immediately above it:
Image from mathisfun.com
The sum of the numbers in any of the rows of the triangle gives the powers of 2: 2, 4, 8, 16, 32, 64, 128.. etc. which correspond to the number of sequences generated by flipping a coin 1, 2, 3, 4, 5, 6, and 7 times, respectively. In other words, if you flip a coin n times, you have any of $%2^n$% sequences which is also the sum of the numbers of the n-th row of Pascal's triangle (when the row at the top is the 0-th row).
The entries in Pascal's triangle can be interpreted as the number of times that a coin will land in, say, heads. For example, if you flip a coin 4 times, you will get one of $%2^4 = 16$% possible sequences. Looking at the 4th row of Pascal's triangle (the one whose entries add up to 16) we have the following correspondance:
1 = # of sequences with 0 heads = TTTT
4 = # of sequences with 1 heads = TTTH, TTHT, THTT, HTTT
6 = # of sequences with 2 heads = TTHH, THTH, HTTH, THHT, HTHT, HHTT
4 = # of sequences with 3 heads = HHHT, HHTH, HTHH, HHHT
1 = # of sequences with 4 heads = HHHH
Likewise, if we flip the coin 7 times we will have $%2^7 = 128$% cases and, looking at Pascal's triangle,
we find that 21 of these sequences have 2 heads, 35 of them have 3 heads, 6 of them have 7 heads, and so on.
Another way to find any of the entries of Pascal's triangle is using the binomial coefficient:
$$\binom{n}{k} = \frac{n!}{k!(n-k)!}$$or $%C(n, k)$%, for short, where $%n!$% is the factorial of n, i.e.,
$$ n! = n(n-1)(n-2)\cdots 2\cdot 1 $$So, for example, if we want to find how many of the $%2^7=128$% sequences generated with 7 flips have 2 heads we have
C(7,2) = 7! / (2! (7-2)!)
= 7! / (2! 5!)
= 5040 / (2 * 120)
= 21
which agrees with the entry in Pascal's triangle.
Now back to the question. We are going to consider all of sequences that have less than 50% heads (i.e., the proportion is a given percentage( e.g., 25% heads) while the range of proportions is from 0 to 50%). We'll consider only the odd number of flips that gives us a nice boundary for the 50% bound.
Flips # sequences # seqs with [0-50)% heads P
1 2^1 = 2 1 (i.e., H) 1*(1/2) = 0.5
3 2^3 = 8 1+3 = 4 4*(1/8) = 0.5
5 2^5 = 32 1+5+10 = 16 16*(1/32) = 0.5
7 2^7 = 128 1+7+21+35 = 64 64*(1/128) = 0.5
etc.
Thus, the probability of the sequences of having less than 50% heads does not get smallerr but instead is constant and, hence, point 4 is False.
5- The probablity of some ranges of proportions becomes small. Consider the probability of having sequences in which the proportion of heads is anywhere between 0 and 33%. Here we will use a larger Pascal's triangle that includes the entries for 9 and 12 flips:
So now, we consider sequences of n flips where flips is a multiple of 3, which gives us a nice boundary for the 33%, i.e., a third of the flips or less have to be heads:
Flips # sequences # seqs with [0-33]% heads P
3 2^3 = 8 1+3 = 4 (TTT, HTT, THT, TTH) 4/8 = 0.5
6 2^6 = 64 1+6+15 = 22 22/64 = 0.343
9 2^9 = 512 1+9+36+84 = 130 130/512 = 0.254
12 2^12 = 4096 1+12+66+220+495 = 794 794/4096 = 0.1938
etc.
where, for example, for 12 flips we have 1 flip with 0 heads, 12 with 1 head, 66 with 2 heads, 220 with 3 heads and 495 with 4 heads, i.e., up to 33% of the possible 12 flips.
A way to visualize this is the following. Look at the numbers that correspond to the 33%: 3 in the 3rd row, 15 in the 6th, 84 in the 9th and 495 in the 12th. Now, notice that all these numbers lie along a line that passes through the apex of the Pascal triangle. You could imagine continuing this line downwards, as you add more and more flips. For all these rows, all the entries to the left of this line correspond to sequences that have between 0 and 33% heads. However, notice that the values of these entries is progressively smaller with respect to those that accumulate in the middle of the rows. Thus, the larger the flip, the smaller the percentage of sequences that will have between 0-33% heads.
By the same token, the entries to the right of the line, which correspond fo the 33-100% heads case, have a number of heads that increases with the number of flips; this is expected as the 0-33% case is the complement of 33-100% case, i.e., if one becomes larger, the other one should become smaller.
You can 'swing' this line to the right, about the apex, until it is vertical. Now the triangle is split in equal parts and the entries on the left and right have the same values. Hence, at this point, the number of sequences that have 0-50% heads is exactly the same as those that have 50-100% heads. This was the case used in point 4 to show that not all range of proportions becomes smaller.
In summary, the probabiity of the sequences that have 33% or less heads (i.e., a range of proportions) grows smaller with the number of flips and point 5 is True
Screenshot taken from Udacity
4 H 0 T
means four head and zero tails.Answer
Screenshot taken from Udacity
Now let me ask you if the probability of having a loaded coin is 0.1, what happens to the probability of fair given flips in each of these cases. Check all that have a probability of a fair coin of less than 0.5.
Answer